package nonogram;

public class Cell {

	private CellType type;

	public Cell() {
		setCellType(CellType.UNKNOWN);
	}

	public Cell(CellType t) {
		setCellType(t);
	}

	public CellType getCellType() {
		return type;
	}

	public void setCellType(CellType t) {
		type = t;
	}

	@Override
	public String toString() {
		switch (type) {
		case BLANK:
			return "*";
		case FILLED:
			return "@";
		case UNKNOWN:
		default:
			return " ";
		}
	}
	
	public String toHtml(String tabs) {
		String str = "";
		
		str += tabs + "<td bgcolor='";
		
		switch (type) {
		case BLANK:
			str += "#CCFFCC";
			break;
		case FILLED:
			str += "#000000";
			break;
		case UNKNOWN:
		default:
			str += "#FFFFFF";
		}
		
		str += "'></td>";
		
		return str;
	}
}
